package com.easy.component.network.api;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * 描述: {描述}
 * 作者:jack-song
 * 创建日期: 2017/9/28 11:02
 * 修改日期: 2017/9/28
 * 版本: {版本}
 */
public interface ApiService {
    @GET
    Call<ResponseBody> getBody(@Url String url);

    @POST
    Call<ResponseBody> postBody(@Url String url);

    @GET()
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    Call<ResponseBody> getJson(@Url String url, @Body RequestBody jsonBody);

    @POST()
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    Call<ResponseBody> postJson(@Url String url, @Body RequestBody jsonBody);

    @Multipart
    @POST()
    Call<ResponseBody> uploadFiles(@Url String url, @PartMap Map<String, RequestBody> map, @Part List<MultipartBody.Part> parts);

    @GET
    Call<ResponseBody> downloadFileWithDynamicUrlSync(@Url String fileUrl);

    @Streaming
    @GET
    Call<ResponseBody> downloadFileWithDynamicUrlAsync(@Url String fileUrl);
}
